[material_ui] Fix todayBorder color being overridden by todayForegroundColor in YearPicker - #12697
[material_ui] Fix todayBorder color being overridden by todayForegroundColor in YearPicker#12697Massinissa-Mouhoub wants to merge 1 commit into
todayBorder color being overridden by todayForegroundColor in YearPicker#12697Conversation
There was a problem hiding this comment.
Code Review
This pull request ensures that DatePickerThemeData.todayBorder is respected over todayForegroundColor in the year selector of the date picker. It updates the border color logic in _YearPickerState, updates the documentation, and adds corresponding regression tests. Feedback on the tests suggests correcting a test description that incorrectly references todayBackgroundColor instead of todayForegroundColor.
| } | ||
|
|
||
| // Regression test for https://github.com/flutter/flutter/issues/189298 | ||
| testWidgets('Non-null todayBorder color should be respected over todayBackgroundColor', ( |
There was a problem hiding this comment.
The test description mentions todayBackgroundColor, but the test actually verifies that todayBorder is respected over todayForegroundColor. We should update the description to match the actual behavior being tested.
| testWidgets('Non-null todayBorder color should be respected over todayBackgroundColor', ( | |
| testWidgets('Non-null todayBorder color should be respected over todayForegroundColor', ( |
todayBorder color being overridden by todayForegroundColor in YearPicker"todayBorder color being overridden by todayForegroundColor in YearPicker
|
Thank you for your contribution! Because of the volume of PRs we receive, we require that new contributors use our checklist to guide them through critical steps in creating a Flutter PR. This PR's description is missing that checklist, so it is being marked as a Draft. Please edit the PR description to add the checklist, then ensure that you have completed all of the steps. Once you've done that, please mark the PR as ready for review. If you need help, consider asking for advice on the #hackers-new channel on Discord. |
This PR ports flutter/flutter#189345 from flutter/flutter to flutter/packages, as part of flutter/flutter#188444.
Fixes flutter/flutter#189298
YearPickerunconditionally overwroteDatePickerThemeData.todayBorder's color with the resolvedtodayForegroundColor, so a custom border color was ignored. The border color is now kept when it is set to a non-transparent color, and the existing fallback totodayForegroundColoris preserved for transparent borders.